
/**
 * 
 * Contains everything we need to know about a player's current state.
 *
 */
public class Player extends BaphiListItem {

	public enum PlayerStatus { Disabled, EnterPlots, GetResults, Waiting, MeetPlayers };

	private PlayerStatus status;
	public Ship ship;
	private int turnNumber;
	private int phasesLeft;
	private int location;
	private boolean landed;
	
	/**
	 * Contains everything we need to know about a player's current state.
	 * @param playerName
	 * @param shipName
	 * @param location
	 * @param cargoCapacity
	 * @param numCommodities - Size of Commodity list. Need this to build CargoHold.
	 */
	public Player(String playerName, String shipName, int location, int cargoCapacity, int numCommodities)
	{
		name = playerName;
		status = PlayerStatus.Disabled;
		ship = new Ship(shipName, cargoCapacity, numCommodities);
		turnNumber = 0;
		phasesLeft = 7;
		this.location = location;
		landed = true;
	}
	
	/**
	 * 
	 * @return PlayerStatus
	 */
	public PlayerStatus getStatus()
	{
		return status;
	}
	
	/**
	 * 
	 * @return number of turns this player has completed
	 */
	public int getTurnNumber()
	{
		return turnNumber;
	}
	
	/**
	 * 
	 * @return Number of unused phases left for this turn
	 */
	public int getPhasesLeft()
	{
		return phasesLeft;
	}
	
	/**
	 * 
	 * @return Current sector number
	 */
	public int getLocation()
	{
		return location;
	}
	
	/**
	 * 
	 * @return On a planet or zipping through space?
	 */
	public boolean isLanded()
	{
		return landed;
	}
}
